import Widget from './Widget'

/** 克隆控件，生成的新控件会丢弃 extra 数据 */
export function cloneWidget(widget: Widget) {
  const { docId, actor, mode, sign, aspectRatio } = widget

  return Widget.createRawWidget(widget.getRawField(), {
    id: undefined,
    docId,
    actor,
    mode,
    linkId: '',
    _sign: sign,
    aspectRatio
  })
}
